#define _CRT_SECURE_NO_WARNINGS 1
int** generate(int numRows, int* returnSize, int** returnColumnSizes) {
    int** ret = (int**)malloc(sizeof(int*) * numRows);
    *returnSize = numRows;
    *returnColumnSizes = (int*)malloc(numRows * sizeof(int*));
    for (int i = 0; i < numRows; i++)
    {
        ret[i] = (int*)malloc(sizeof(int*) * (i + 1));
        (*returnColumnSizes)[i] = i + 1;
    }
    for (int i = 0; i < numRows; i++)
    {
        for (int j = 0; j <= i; j++)
        {
            if (j == 0 || (j == i))
                ret[i][j] = 1;
            else
                ret[i][j] = ret[i - 1][j] + ret[i - 1][j - 1];
        }

    }
    return ret;
}